<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" 	uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" 	%>
<%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql" 	%> 

<jsp:include page="./dbChatConfig.jsp" flush="false"/>

<sql:query var="selectFromTab" dataSource="${oracleDs}" >
	 select * from tab 
</sql:query>

<sql:query var="selectSysDateFromDual" dataSource="${oracleDs}" >
	 select sysdate from dual 
</sql:query>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title> JSP DB 연결 테스트 . </title>
</head>
<body>
	<h3><a href="../index.html">첫 페이지</a></h3>
	<h3> JSP DB 연결 테스트 </h3> 
	<h4>
		<c:forEach var="row" items="${selectSysDateFromDual.rows}" >
			${ row.SYSDATE }
		</c:forEach>
	</h4>
	<div>
		<table>
			<thead>
				<tr>
					<th>테이블 형태</th>
					<th>테이블 이름</th>
				</tr>
			</thead>
			<tbody>
				<c:forEach var="row" items="${selectFromTab.rows}" >
					<tr>
						<td>[ ${ row.TABTYPE 	} ]</td>
						<td> ${ row.TNAME	} </td>
						<td> ${ row.TNAME	} </td>					  
					</tr>
				</c:forEach>
			</tbody>
			<tfoot>
				<tr>
					<td></td><td></td>
				</tr>
			</tfoot>
		</table>
	</div> 
</body>
</html>